package chpt09;

public class HelloWorldMainThread {

	public static void main(String[] args) {
		// 获取运行main方法所在的线程名
		String name = Thread.currentThread().getName();
		System.out.println("1. " + name + " begin!");
		System.out.println("2. Hello World!");
		doSth();
		System.out.println("5. " + name + " end!");
	}

	private static void doSth() {
		// 获取运行doSth方法所在的线程名
		String name = Thread.currentThread().getName();
		System.out.println("3. doSth():" + name + " do sth!");
		System.out.println("4. doSth():" + name + " quit!");
	}
}
